/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package de.kipcorn.App;


import generated.AwaitMoveMessageType;
import generated.BoardType.Row;
import generated.CardType;
import generated.MazeCom;
import generated.MazeComType;
import generated.ObjectFactory;
import generated.PositionType;
import java.util.List;
import networking.MazeComMessageFactory;

/**
 *
 * @author lars.kloeser
 */
public class MoveFactory  extends MazeComMessageFactory{

    static private ObjectFactory of = new ObjectFactory();
    
	public MazeCom createMoveMessage(int newID,AwaitMoveMessageType await) {
		MazeCom mc = of.createMazeCom();
		mc.setMcType(MazeComType.MOVE);
		mc.setId(newID);
		mc.setMoveMessage(of.createMoveMessageType());
        CardType card = await.getBoard().getShiftCard();
        PositionType pos = new PositionType();
		pos.setCol(0);
        pos.setRow(1);
        mc.getMoveMessage().setShiftPosition(pos);
        mc.getMoveMessage().setShiftCard(card);
        PositionType posPlayer = new PositionType();
        posPlayer.setCol(0);
        posPlayer.setRow(0);
        mc.getMoveMessage().setNewPinPos(posPlayer);
		return mc;
	}

}
